expansion of algebraic expressions